package com.example.springboottest.student.ws.impl;

import com.example.springboottest.student.model.Student;
import com.example.springboottest.student.service.StuService;
import com.example.springboottest.student.ws.StuWSService;
import lombok.extern.slf4j.Slf4j;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;

import javax.jws.WebService;

@WebService(serviceName = "StuWSService",//对外发布的服务名
        targetNamespace = "http://service.webservice.fn.com",//指定你想要的名称空间，通常使用使用包名反转
        endpointInterface = "com.example.springboottest.student.ws.StuWSService")
//服务接口全路径, 指定做SEI（Service EndPoint Interface）服务端点接口
@Slf4j
@Service("stuWSService")
public class StuWSServiceImpl implements StuWSService {
    //这个地方是测试下log
    private Logger fileLog = LoggerFactory.getLogger("com.example.springboottest.student.service");

    @Autowired
    @Qualifier("stuMybatisService")
    private StuService stuService;

    @Override
    public Student getStudent(String id) {
        fileLog.info("fileLog打印\tStuWSService.getStudent 接收到请求 \t" + id);
//        log.info("log打印\tStuWSService.getStudent 接收到请求 \t" + id);
        return stuService.doFindById(id);
    }
}
